<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str = "hello210874"
        var reg = /[^a-z]/g
        console.log(str.replace(reg,""));

        /* 过滤标签 */
        var str = "<p>我是p标签</p>。<div>我是div</div>"
        var reg = /<[^<>]+>/g
        console.log(str.replace(reg,"")); // 我是p标签。我是div

        var str = "https://movie.douban.com/subject/1292052/"
        // 只获取数字
        var reg = /[^\d+]/g
        console.log(str.replace(reg,""));
    </script>
</body>
</html>